// 导入axios封装
import $http from '../../common/http'
const state = {
    courselist:[],
}

const actions = {
    COURSELIST(context, type) {
        $http.get('api/course?type=' + type)
            .then(
                res => {
                    console.log("action",res.data);
                    context.commit('COURSELIST', res.data)
                }
            )
    }
}

const mutations = {
    COURSELIST(state, item) {
        
        state.courselist = item;
        console.log('mutations state.courselist',state.courselist);
        
    }
}

export default {
    state,
    actions,
    mutations
}